package org.jeecg.modules.flowable.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.flowable.dto.FlowRoleDTO;
import org.jeecg.modules.flowable.dto.FlowUserDTO;
import org.jeecg.modules.flowable.entity.FlowCategory;
import org.jeecg.modules.flowable.service.FlowCategoryService;
import org.jeecg.modules.flowable.service.FlowOperatorService;
import org.jeecg.modules.flowable.vo.FlowCategoryVO;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@Api(tags = "流程操作人")
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/flow/operator")
public class FlowOperatorController {

    final FlowOperatorService flowOperatorService;

    @ApiOperation(value = "指定流程办理人员列表")
    @GetMapping("/userList")
    public Result userList(FlowUserDTO user) {
        List<FlowUserDTO> list = flowOperatorService.getAllUser();
        return Result.OK(list);
    }

    @ApiOperation(value = "指定流程办理角色组列表")
    @GetMapping("/roleList")
    public Result roleList(FlowRoleDTO role) {
        List<FlowRoleDTO> list = flowOperatorService.getAllRole();
        return Result.OK(list);
    }

    @ApiOperation(value = "指定流程办理部门组列表")
    @GetMapping("/deptList")
    public Result deptList(FlowRoleDTO role) {
        List<FlowRoleDTO> list = flowOperatorService.getAllRole();
        return Result.OK(list);
    }


}
